package com.twu.biblioteca.command;

import com.twu.biblioteca.BibliotecaApp;

/**
 * Created by jjwang on 4/23/14.
 */
public class Logout implements Command {
    @Override
    public String doExecute(BibliotecaApp app) {
        app.setCurrentUser(null);
        app.getMenu().put("l",new Login());
        app.getMenu().remove("p");
        System.out.println("Logout successfully!");
        return app.getMenu().get("h").doExecute(app);
    }

    @Override
    public String getName() {
        return "Logout";
    }
}
